<template>
	<up-action-sheet :show="show" :actions="actions" round="12" :cancelText="cancelText" :safeAreaInsetBottom="false" closeOnClickAction  @select="handleSelectClick" @close="close" />
</template>

<script setup>
import { ref } from 'vue'

const props = defineProps({
  value: {
    type: Object,
		default: {}
  },
	actions: {
		type: Array,
		default: []
	},
	cancelText: {
		type: String,
		default: '取消'
	}
})

const emits = defineEmits(['select'])
const show = ref(false);

  const open = () => {
    show.value = true;
  }

  const close = () => {
    console.log('close');
    show.value = false;
  }

  const handleSelectClick = item => {
    console.log('handleSelectClick', item);
    setTimeout(() => emits('select', item), 300)
  }

  defineExpose({ open, close })
</script>

<style lang="scss">

</style>